<?php
class Zend_View_Helper_HtmlObjects extends Zend_View_Helper_Abstract
{
  public function htmlObjects($type,$name,$value=null,$additional=array())
  {
    switch ($type)
    {
      case 'text':
        $htmlObject=new Zend_View_Helper_FormText();
        $htmlObject->setView($this->view);
        return $htmlObject->formText($name,$value, array('class'=> str_replace('[]', '', $name)));
        break;
      case 'date':
        $htmlObject=new Zend_View_Helper_FormText();
        $htmlObject->setView($this->view);
        return $htmlObject->formText($name,$value,array('readonly'=>'readonly','style'=>'float:left','class'=> str_replace('[]', '', $name)));
        break;
      case 'small_number':
        $htmlObject=new Zend_View_Helper_FormText();
        $htmlObject->setView($this->view);
        return $htmlObject->formText($name,$value,array('size'=>'5','onkeypress'=>'return onlyNumbers(event);','class'=> str_replace('[]', '', $name)));
        break;
      case 'folio':
        $htmlObject=new Zend_View_Helper_FormText();
        $htmlObject->setView($this->view);
        return $htmlObject->formText($name,$value,array('size'=>'5','readonly'=>'readonly','class'=> str_replace('[]', '', $name)));
        break;
      case 'number':
        $htmlObject=new Zend_View_Helper_FormText();
        $htmlObject->setView($this->view);
        return $htmlObject->formText($name,$value,array_merge(array('onkeypress'=>'return onlyNumbers(event);','class'=> str_replace('[]', '', $name)),$additional));
        break;
      case 'comment':
        $htmlObject=new Zend_View_Helper_FormTextarea();
        $htmlObject->setView($this->view);
        return $htmlObject->formTextarea($name,$value,array('cols'=>'50','rows'=>'5','class'=> str_replace('[]', '', $name)));
        break;
    }
  }
}
?>
